package com.woniuxy.oldobject.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.oldobject.dao.AddressDao;
import com.woniuxy.oldobject.entity.Address;
import com.woniuxy.oldobject.entity.pageData;
import com.woniuxy.oldobject.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * description: AddressServiceImpl <br>
 * date: 2022/7/20 2:17 下午 <br>
 * author: shesaifei <br>
 * version: 1.0 <br>
 */
@Service
public class AddressServiceImpl extends ServiceImpl<AddressDao, Address> implements AddressService {
    @Autowired
    private AddressDao addressDao;

    @Override
    public Address queryById(Integer id) {
        return addressDao.queryById(id);
    }

    /**
     * 通过实体作为筛选条件查询
     *
     * @param pageData 实例对象
     * @return 对象列表
     */
    @Override
    public List<Address> queryAll(pageData pageData) {
        return addressDao.queryAll(pageData);
    }

    /**
     * 根据题目id,批量删除地址
     *
     * @param pageData
     * @return
     */
    @Override
    public int deleteAllAddressByIds(pageData pageData) {
        return addressDao.deleteAllAddressByIds(pageData);
    }

}
